package com.csweimei.rentmanagementtreasure.tenant.viewModel;

import android.os.Bundle;

import androidx.annotation.NonNull;
import androidx.databinding.ObservableField;

import com.csweimei.rentmanagementtreasure.base.AppConfig;
import com.csweimei.rentmanagementtreasure.http.entity.SearchEntBean;
import com.csweimei.rentmanagementtreasure.tenant.ui.act.dayPaper.JoinTeamActivity;

import me.goldze.mvvmhabit.base.BaseViewModel;
import me.goldze.mvvmhabit.base.MultiItemViewModel;
import me.goldze.mvvmhabit.binding.command.BindingAction;
import me.goldze.mvvmhabit.binding.command.BindingCommand;

public class SearchEntItemVM extends MultiItemViewModel {
    public SearchEntItemVM(@NonNull BaseViewModel viewModel) {
        super(viewModel);
    }

    public ObservableField<SearchEntBean.DataDTO> entity = new ObservableField<>();
    public void setData(SearchEntBean.DataDTO bean) {
        entity.set(bean);
    }

    public BindingCommand joinClick = new BindingCommand(new BindingAction() {
        @Override
        public void call() {
            Bundle bundle = new Bundle();
            bundle.putSerializable(AppConfig.BUNDLE_KEY,entity.get());
            viewModel.startActivity(JoinTeamActivity.class,bundle);
        }
    });

}
